from sqlalchemy import Column, Integer, String, Boolean, Time
from database import Base
from datetime import time


# 用户表
class User(Base):
    # 表名users
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True, autoincrement=True)
    username = Column(String(64), unique=True, nullable=False)
    password = Column(String(64), nullable=False)
    is_sa = Column(Boolean, default=False)
    ip_addr = Column(String, nullable=False)
    last_login = Column(Time)
    modified_date = Column(Time, nullable=False)
    created_date = Column(Time, default=time(), nullable=False)
